{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [],
   "source": [
    "from Crypto.Util.number import long_to_bytes"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [],
   "source": [
    "data = [int(x) for x in \"000101010011010110011110011100000101000001111110010111000110001001111111000101110111000110101110100101000110001010010101101110110010010011110010000110010110101010001001100101001100110011100010101110001010101110110110111011110011110100101001001110111111001110001101001000100010000000111001000101111001100110111001111011111011011100001101100001000111010101111001111010100110111110100011000110100111010000000110010011001001011011100101100000010101001111101010000100110001011111111000100100100101011110111000110100010111011001110010110111001000000010001010010000100110101010110000101110100010111101001011100110001010000000000000111001001111110001001101000011000011111100000111111100101110101110111101111001001000011010000111001111011100111010011110100101111011011010111000110011111010001101111010011110110101111101010101101110101110111001100000010101101110100000011001010000101100111010101000101011010100010101100000100000011011010011001100011101110011001101101111101001010110011010110000011000000001011111000110001110000011101101100010101011001101001111010111011000011011011000011001101010100010011000101011001100000111010011001101100000011101101111111001001111011011000000111110101110111000001100001100010101011011110001011010001011010000010100011001010110100110011010111001110111100110101000011110101111110001010110110111100000100100111011001010101000100001001101000111100000011100100101100111101001001111111100001011101011010110011111101001110101101001001111111010011100000000101010101100001011001111000000010000100011001011001101011001101010000011001010111010001110111000011101000110001110110110110000010010001111011110001111110111011110101100011001111001111010000101011010110000101001100110000110010110000101100101001011010011101110010100110111111101111011011111000100100011001111010111110000010111100101001010100001101100101010101100010100011000111110111110001000101011110011111000000010110101111011100001001011101000111000010011011011001001101001011010001110100000101101001001110100110011101111000110111011000001101110\"][8:400]\n",
    "key = [x-8 for x in [8,23,114,211,360]]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {},
   "outputs": [],
   "source": [
    "for x in range(2022):\n",
    "    bit = data[-1]\n",
    "    data = [0] + data[:-1]\n",
    "    for k in key:\n",
    "        bit ^= data[k]\n",
    "    data[0] = bit\n",
    "    "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "b'oectf{Bru!e_@r_so1^e_A_sy3teM_0f_eq&aT10n3?}()6.S'"
      ]
     },
     "execution_count": 7,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "long_to_bytes(int(\"\".join([str(x) for x in data]),2))"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3.9.12 ('base')",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.9.12"
  },
  "orig_nbformat": 4,
  "vscode": {
   "interpreter": {
    "hash": "8030bfa346eaa1b62dcec5f4ac09f0d7f893976167f51ff613121c4f194611b1"
   }
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
